import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;

public class DrawGraphics {
    BouncingBox box;
    BouncingBall ball;
    ArrayList<BouncingBox> boxList = new ArrayList<>();
    
    /** Initializes this class for drawing. */
    public DrawGraphics() {
        box = new BouncingBox(200, 50, Color.RED);
        for(int i = 0; i<3; ++i){
            boxList.add(new BouncingBox(10*i, 10*i, Color.GREEN));
            boxList.get(i).setMovementVector((i+1)*10, i);
        }
        ball = new BouncingBall(100,20, Color.BLUE);
        ball.setMovementVector(5, 5);
    }

    /** Draw the contents of the window on surface. Called 20 times per second. */
    public void draw(Graphics surface) {
        surface.drawLine(50, 50, 250, 250);
        surface.drawArc(0, 0, 25, 25, 0, 180);
        surface.drawRect(50, 50, 25, 25);
        surface.drawString("Hello Java!", 10, 80);
        box.draw(surface);
        ball.draw(surface);
        for(BouncingBox b : boxList){
            b.draw(surface);
        }
    }
} 